package com.personal.mapper;

import com.personal.pojo.TCourse;
import com.personal.pojo.TCourseExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TCourseMapper {
    //根据课程名查询，模糊查询
    List selectName(String coursename);
    //修改报名人数
    int editApply(@Param("mems")int mems,@Param("courseid")Integer courseid);
    //将开始课程状态置为2，
    int starCourse(String starTime);
    //将结束课程状态置为0，
    int endCourse(String endTime);

    int countByExample(TCourseExample example);

    int deleteByExample(TCourseExample example);

    //删除课程
    int deleteByPrimaryKey(Integer courseid);

    int insert(TCourse record);

    //插入课程
    int insertSelective(TCourse record);

    //查询状态为报名中的所有课程
    List<TCourse> selectByExample(TCourseExample example);
    //查询状态为非结束的课程
    List<TCourse> selectNotEnd();
    //查询状态为结束的课程
    List<TCourse> selectCourseEnd();
    //根据coachid查询教练任教的课程，用来形成课程表
    List<TCourse> selectByCoachid(Integer coachid);

    TCourse selectByPrimaryKey(Integer courseid);

    int updateByExampleSelective(@Param("record") TCourse record, @Param("example") TCourseExample example);
    //暂时删除
    int updateState0(Integer courseid);
    //暂时批量删除
    int delCourseBatch0(@Param("courseids")Integer[] courseids);
    //彻底批量删除
    int delCourseBatch1(@Param("courseids")Integer[] courseids);
    //恢复课程
    int updateState1(Integer courseid);
    //根据id修改课程信息
    int updateByPrimaryKeySelective(TCourse record);

    int updateByPrimaryKey(TCourse record);

    //1.1多条件查询，金额范围，课程名
    List selectByMoneyName(@Param("minMoney")Float minMoney,@Param("maxMoney")Float maxMoney,@Param("courseName")String courseName);
    //1.2多条件查询，时间范围，课程名
    List selectByTimeName(@Param("weekid")Integer weekid,@Param("sectionid")Integer sectionid,@Param("courseName")String courseName);
    //1.3admin多条件查询课程，上课日期，上课教室，课程名
    List selectByWCC(@Param("courseweek")Integer courseweek,@Param("classroomid")Integer classroomid,@Param("coursename")String coursename);
}